home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
BMPSIZE.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
4KB
|
62 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME BMPSIZE .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NBV1.INC"
SCREEN 12
CLS
GraphicSETUP
COLOR 7, 0
? "┌──────────────────────────────────────────────────────────────────────
? "│ PowerBASIC's formula for computing the number of bytes/elements that
? "│ are required to hold a bit-mapped image is a bit long so here are
? "│ some functions that will do the job for you. They all return about
? "│ the same data but how they get their input is the difference.
? "│ As their names emply, 1/2 of the functions return the exact number
? "│ of bytes required to store the image while the other 1/2 return the
? "│ number of words (2 bytes) required.
? "│ It is assumed that the incoming BitMapped data is in the same format
? "│ as is used by PowerBASIC: ie 1 word = Columns 2ed word = Rows
? "│ It is also assumed that we are working on only 1 plane (monochrome)
? "└───────────────────────────────────────────────────────────────────────
?
'┌────────────────────────────────
Cs% = 100 : Rs% = 197 '│ columns & rows
'│
DIM BMParr%( Cs% ) '│ a buffer array for fGetXArr??
BMParr%(0) = Cs% '│ 1st word = # of columns
BMParr%(1) = Rs% '│ 2ed word = # of rows
'│
PRINT fBMPwords% ( Cs%, Rs% ) '│ when you know the cols/rows
PRINT fBMPwordsArr% ( BMParr%(0) ) '│ compute it from the array
PRINT '│ (same process for strings)
'│
PRINT fBMPbytes?? ( Cs%, Rs% ) '│ ditto
PRINT fBMPbytesArr?? ( BMParr%(0) ) '│
PRINT '│
'│
PRINT ( 4 + CEIL( Cs% / 8 ) * 1 * Rs% ) '│ PowerBASIC's formula for 1plane
PRINT '│
'│
PRINT fICONwords% (1,1,Cs%,Rs%) '│ these 2 come in handy when you
PRINT fICONbytes?? (1,1,Cs%,Rs%) '│ have the C1%,R1%,C2%,R2% for the
'│ box, you don't have to stop &
'│ compute the columns/rows first
'└──────────────────────────────────